<template>
	<view>
		<view class="toggleItem">
			<view class="toggleItemInhalt">
				<!-- <view class="optionId" :class="clicknum==1?'Select':'Unchecked'" @click="$replaceTo('/ipo_list')">{{$t('subscribe.open')}}</view> -->
				<view class="optionId" :class="clicknum==1?'Select':'Unchecked'" @click="$replaceTo('/')">{{$t('subscribe.open')}}</view>
				<view class="optionId" :class="clicknum==2?'Select':'Unchecked'" @click="isActive(2)">{{$t('subscribe.to-be-list')}}</view>
				<view class="optionId" :class="clicknum==3?'Select':'Unchecked'" @click="$replaceTo('/orders_history')">{{$t('subscribe.orders')}}</view>
			</view>
		</view>
		
		<view class="detail" v-for="(item,index) in list" :key='index' v-if="clicknum==2" @click="$navTo('/ipo_details',{id:item.id})">
			<navigator url="new-certification">
			<view class="abox">
				<view>
					<view class="leftbox">
						<!-- <view class="alefTtext">{{$t('company.semi-holdings')}}</view> -->
						<view class="alefTtext">{{$getLocaleField(item, 'company_name')}}</view>
					</view>
					<view class="belowbox">
						<logo pattern="2" :text="item.location"></logo>
						<view class="b_blowtext">{{item.symbol}}</view>
					</view>
				</view>
			</view>
			<view class="bbox">
				<view class="bleft">
					<view class="bleftbox bleftmagin">
						<view class="ableftText">{{$t('to_be_list.issue-price')}}</view>
						<!-- <view class="bleftText">{{item.IssuePrice.toLocaleString()}}</view> -->
						<view class="bleftText">-</view>
					</view>
					<view class="bleftbox">
						<view class="ableftText">{{$t('to_be_list.allot-results')}}</view>
						<!-- <view class="bleftText">{{item.AllocationRate}}</view> -->
						<view class="bleftText">-</view>
					</view>
				</view>
				<view class="bbottom">
					<view class="bleftbox bleftmagin">
						<view class="ableftText">{{$t('to_be_list.results-annc')}}</view>
						<!-- <view class="bleftText">{{item.ResultAnncDate}}</view> -->
						<view class="bleftText">{{$timeToStr(item.allotment_result_date)}}</view>
					</view>
					<view class="bleftbox">
						<view class="ableftText">{{$t('to_be_list.exp-listing')}}</view>
						<!-- <view class="bleftText">{{item.ExpListingDate}}</view> -->
						<view class="bleftText">{{$timeToStr(item.listing_date)}}</view>
					</view>
				</view>
			</view>
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				time:0,
				clicknum:2,
				list: [],
			}
		},
		onLoad() {
			this.$appLogin(()=>{
				this.getList()
			})
		},
		methods: {
			isActive(clicknum){
				if(this.clicknum != clicknum){
					this.clicknum = clicknum
				}
				if(clicknum === 3) {
					uni.navigateTo({
						url: "subscribe_record"
					})
				}
			},
			getList(){
				this.$httpGet({
					// url:'test/gp_list',
					url:'ipos/list',
					data: {
						type: 2
					}
				}).then((res)=>{
					// for(var i in res.data.list){
					// 	res.data.list[i].distance_time = this.$getDistanceSpecifiedTime(res.data.list[i].SubCloseTime)
					// }
					for(var i in res.data.list){
						res.data.list[i].rcf = parseFloat(((res.data.list[i].min_order_size * res.data.list[i].current_price_used_for_creditcheck) * 1.010085).toFixed(2))
						res.data.list[i].distance_time = this.$getDistanceSpecifiedTime(res.data.list[i].application_end_date_time)
					}
					this.list = res.data.list
				})
			}
		}
	}
</script>

<style lang="scss">
	
	page{
		background-color: #f4f5f7;
	}

	.onebox{
		height: 181rpx;
		width: 100%;
		display: flex;
		padding-left: 53rpx;
		background-color: #FFFFFF;
		margin-top: 1rpx;
		padding-top: 26rpx;
		box-sizing: border-box;
	}
	
	.img_list{
		width: 120rpx;
		// margin-right: 63rpx;
	}
	
	
	.one_left{
		width: 268rpx;
	}
	
	.login_btn{
		width: 268rpx;
		height: 70rpx;
		line-height: 70rpx;
		text-align: center;
		color: #FFFFFF;
		background-color: $main-color;
		border-radius: 8rpx;
		font-size: 26rpx;
	}
	
	.apply_text{
		width: 120rpx;
		font-size: 27rpx;
		color: $main-color;
		border-bottom-style: solid;
		border-bottom-width: 1rpx;
		border-bottom-color: $main-color;
		text-align: center;
		margin: auto;
		margin-left: 81rpx;
		margin-top: 23rpx;
	}
	
	.linebox{
		width: 1rpx;
		height: 120rpx;
		background-color: #eeeeee;
		margin-left: 53rpx;
		margin-top: 4rpx;
	}
	
	.one_right{
		// margin-left: 55rpx;
		display: flex;
		justify-content: space-around;
		margin-top: 15rpx;
		flex-grow: 1;
	}
	
	.img{
		width: 49rpx;
		height: 49rpx;
		margin: auto;
		display: block;
		// margin-left: 32rpx;
	}
	
	.text_record{
		font-size: 22rpx;
		color: #333333;
		margin-top: 28rpx;
		text-align: center;
	}
	
	
	.toggleItem {
		border-width: 1rpx;
		border-color: #eeeeee;
		border-top-style: solid;
		background-color: #FFFFFF;
		.toggleItemInhalt {
			width: 695rpx;
			display: flex;
			margin: 0 auto;
			align-items: center;
			flex-flow: row nowrap;
			// justify-content: space-between;
			justify-content: space-around;
			.optionId {
				width: 180rpx;
				text-align: center;
				padding-top: 20rpx;
				padding-bottom: 20rpx;
	
			}
			
			.Select {
				color: $main-color;
				border-bottom-style: solid;
				border-bottom-color: $main-color;
			}
		}
	}
	
	.cutbox{
		width: 100%;
		// height: 80rpx;
		background-color: #FFFFFF;
	}
	
	.cutText{
		font-size: 30rpx;
		padding-bottom: 20rpx;
		border-bottom-width: 5rpx;
		margin-top: 25rpx;
		font-weight: 500;
	}
	
	.cutgray{
		/* border-bottom-style: solid; */
		color: $font-color-two;
	}
	
	.cutblue{
		border-bottom-style: solid;
		color: $main-color;
		border-bottom-color: $main-color;
	}
	
	.cutmagin{
		width: 695rpx;
		margin: auto;
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		/* margin-top: 40rpx; */
	}
	
	.detail{
		margin: auto;
		// margin-top: 14rpx;
		// width: 710rpx;
		margin: 14rpx 20rpx 0rpx 20rpx;
		padding-bottom: 33rpx;
		background-color: #FFFFFF;
		border-radius: 8rpx;
		padding-top: 40rpx;
	}
	
	.abox{
		// width: 660rpx;
		margin: auto 25rpx;
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
	}
	
	.leftbox{
		display: flex;
		align-items: center;
	}
	
	.alefTtext{
		font-size: 28rpx;
		height: 30rpx;
		line-height: 30rpx;
		font-weight: 550;
		margin-right: 14rpx;
	}
	
	.btagbox{
		margin-left: 13rpx;
		background-color: #e4f1ff;
		color: $main-color;
		width: 90rpx;
		height: 30rpx;
		text-align: center;
		font-size: 23rpx;
		line-height: 30rpx;
		/* margin-top: 4rpx; */
	}
	
	.belowbox{
		margin-top: 17rpx;
		display: flex;
		align-items: center;
	}
	
	.ablowtext{
		width: 40rpx;
		height: 20rpx;
		line-height: 20rpx;
		color: #FFFFFF;
		background-color: #d6abff;
		font-size: 20rpx;
		text-align: center;
		margin-right: 10rpx;
	}
	
	.b_blowtext{
		font-size: 20rpx;
		color: $font-color-two;
		height: 20rpx;
		line-height: 20rpx;
		margin-left: 11rpx;
	}
	
	.aboxbtn{
		margin-top: 7rpx;
		width: 120rpx;
		border-radius: 90rpx;
		border-color: $main-color;
		border-style: solid;
		border-width: 1rpx;
		line-height: 50rpx;
		text-align: center;
		font-size: 28rpx;
		color: $main-color;
	}
	
	.bbox{
		// width: 660rpx;
		margin: auto 25rpx;
		margin-top: 38rpx;
	}
	
	.lastTime{
		color: #ff8080;
	}
	
	.bleft{
		display: flex;
	}
	
	.bleftbox{
		height: 27rpx;
		width: 50%;
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: center;
		
	}
	
	.bleftmagin{
		margin-right: 32rpx;
	}
	
	.bbottom{
		display: flex;
		margin-top: 34rpx;
	}
	
	.ableftText{
		font-size: 24rpx;
		color: $font-color-three;
		white-space: nowrap;
	}
	
	.bleftText{
		font-size: 24rpx;
		color: $font-color-two;
		white-space: nowrap;
	}
</style>
